load("//bazel:skia_rules.bzl", "exports_files_legacy", "generate_cpp_files_for_headers", "skia_filegroup", "split_srcs_and_hdrs")

package(
    default_applicable_licenses = ["//:license"],
)

licenses(["notice"])

exports_files_legacy()

TESSELLATE_FILES = [
    "AffineMatrix.h",
    "CullTest.h",
    "FixedCountBufferUtils.cpp",
    "FixedCountBufferUtils.h",
    "LinearTolerances.h",
    "MiddleOutPolygonTriangulator.h",
    "MidpointContourParser.h",
    "PatchWriter.h",
    "StrokeIterator.h",
    "Tessellation.cpp",
    "Tessellation.h",
    "WangsFormula.h",
]

split_srcs_and_hdrs(
    name = "tessellate",
    files = TESSELLATE_FILES,
)

skia_filegroup(
    name = "srcs",
    srcs = [":tessellate_srcs"],
    visibility = ["//src/gpu:__pkg__"],
)

skia_filegroup(
    name = "private_hdrs",
    srcs = [":tessellate_hdrs"],
    visibility = [
        "//src/gpu:__pkg__",
        "//src/gpu/ganesh:__pkg__",
    ],
)

generate_cpp_files_for_headers(
    name = "headers_to_compile",
    headers = [
        "AffineMatrix.h",
        "CullTest.h",
        "LinearTolerances.h",
        "MiddleOutPolygonTriangulator.h",
        "MidpointContourParser.h",
        "PatchWriter.h",
        "StrokeIterator.h",
        "WangsFormula.h",
    ],
)
